package com.ysd.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ysd.dao.impl.MohuDaoImpl;
import com.ysd.dao.impl.ProductclassifiCationTableDaoImpl;
import com.ysd.entity.ProductclassifiCationTable;
import com.ysd.entity.Productdetailsinfo;

public class Mohuservlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html");
		HttpSession session = request.getSession();
		
		String sou = request.getParameter("sou");
		MohuDaoImpl XDao = new MohuDaoImpl();
		ArrayList<Productdetailsinfo> getmohu = XDao.getmohu(sou);
		request.setAttribute("cx", getmohu);
		session.setAttribute("cx", getmohu);
		
		ProductclassifiCationTableDaoImpl cDao = new ProductclassifiCationTableDaoImpl();
		List<ProductclassifiCationTable> list = cDao.gatProductclassifiCationTables();
		request.setAttribute("pc", list);
		
		request.getRequestDispatcher("NewFile.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
